﻿
Public Class DelegateCommand(Of T)
    Implements Windows.Input.ICommand

    Private method As Action(Of T)

    Sub New(method As Action(Of T))
        ' TODO: Complete member initialization 
        Me.method = method
    End Sub

    Public Function CanExecute(parameter As Object) As Boolean Implements Windows.Input.ICommand.CanExecute
        Return True
    End Function

    Public Event CanExecuteChanged(sender As Object, e As EventArgs) Implements Windows.Input.ICommand.CanExecuteChanged

    Public Sub Execute(parameter As Object) Implements Windows.Input.ICommand.Execute
        method.Invoke(parameter)
    End Sub
End Class
